/**
 * Created by LXH on 2017/10/31.
 */
import axios from './axios.js'
import qs from 'qs'
import store from'../vuex/'
import {tl} from'../mixin/tool'
import {utility} from '../assets/js/utility/utility'

export const actService = {
    /* 获取活动列表
     * 活动排序(publishTime,actEndTime,actReadNum)
     * */
    getactivities: function (params) {
        return axios.get('/activities/'+tl.getParam(params))
    },
    // 活动详情
    getActivities: function(params){
        return axios.get('/activities/'+params.activityId)
    },
    /* 获取列表 */
    getcolumns: function (params) {
        return axios.get('/columns/'+tl.getParam(params))
    },
    // 首页知识请求
    listKnow: function(params){
        // return axios.get('/columns'+ this.getParam(params))
        return axios.get('/columns'+ tl.getParam(params))
    },
    /* 获取文章列表 */
    getThemes: function (params) {
        return axios.get('/dictionarys/list'+ tl.getParam(params))
    },
    /* 获取列表 */
    getactivity: function (id) {
        return axios.get('/activities/'+id)
    },
    /* 获取列表 */
    myFollowMain: function (params) {
        return axios.get('/myFollowMain/'+tl.getParam(params))
    },
    /* 关注 */
    isFollow: function (params) {
        if(params.adminId*1===1) return;
        return axios.get('/isFollow/'+tl.getParam(params))
    },
    /* 关注 */
    myFollow: function (params) {
        return axios.post('/myFollow/'+tl.getParam(params))
    },
    /* 取消关注 */
    cancelFollow: function (params) {
        return axios.put('/cancleFollow'+tl.getParam(params))
    },
    /* 取消关注 */
    getpeople: function (params) {
        return axios.get('/activities/people'+tl.getParam(params))
    },
    /* 获取列表 */
    gettickets: function (params) {
        return axios.get('/activities/'+params.actId+'/tickets/'+tl.getParam(params))
    },
    /* 获取列表 */
    signActivity: function (params) {
        return axios.get('/activities/'+params.actId+'/sign/'+tl.getParam(params))
    },
    /* 获取列表 */
    checkTicket: function (params) {
        return axios.post('/activities/'+params.actId+'/check/'+tl.getParam(params))
    },
    // 活动电子票
    eleTicket: function(params){
        return axios.get('mytickets/'+params.randomId)
    },
    /* 获取列表 */
    postApplyInfo: function (params) {
        return axios.post('/activities/'+params.actId+'/apply/',qs.stringify(params))
    },
    /* 获取列表 */
    createOrder: function (params) {
        return axios.post('/activities/'+params.actId+'/order/',qs.stringify(params))
    },
    /* 获取列表 */
    getColumns: function (params) {
        return axios.get('/columns/'+tl.getParam(params))
    },
    /* 获取列表 */
    collect: function (params) {
        return axios.post('/activities/'+params.activityId+'/collect/'+tl.getParam(params))
    },
    /* 获取列表 */
    getcollect: function (params) {
        return axios.get('/users/collect/exist/'+tl.getParam(params))
    },
    // 根据ticketNo查询电子票
    TicketNum: function(params){
        return axios.get('mytickets/ticket/'+params.ticketNo)
    },
    // 扫码签到
    scanSign: function (params) {
        return axios.put('mytickets/scansign' + tl.getParam(params));
    },
    // 手动签到
    handSign: function (params) {
        return axios.put('mytickets/sign' + tl.getParam(params));
    },
    // 签到管理员
    checkadmins: function (params) {
        return axios.put('checkadmins' + tl.getParam(params));
    },
    // JS-SDK微信接口config
    weChatConfig: function (params) {
        return axios.get('wxconfig' + tl.getParam(params));
    },
    // 验证取票
    getTickets: function (params) {
        return axios.get('mytickets/picktickets' + tl.getParam(params));
    },
}
// export default {loginService}
